﻿@{
    Layout = "";
}

<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
<title>锁客宝</title>
<link rel="icon" href="~/admui-13945148017-1592211513218/public/images/48599591f566cbb11c676bd496f2e29 (2).png">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.1.3/css/bootstrap.min.css">
<!-- my-customer CSS -->
<link rel="stylesheet" href="~/GoTRI/css/my-customer.css">
<link rel="stylesheet" href="~/GoTRI/css/mobiscroll.custom.min.css">
<link rel="stylesheet" href="~/GoTRI/css/tel-note.css">
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="~/GoTRI/js/jquery-3.2.1.min.js"></script>
<script src="~/GoTRI/js/popper.min.js"></script>
<script src="https://cdn.staticfile.org/twitter-bootstrap/4.1.3/js/bootstrap.min.js"></script>
<!--my-customer JS -->
<script src="~/GoTRI/js/my-customer.js"></script>
<script src="~/GoTRI/js/mobiscroll.custom.min.js"></script>
<style>
    /* .section {
            position: relative;
            height: 32px;
            padding-left: 80px;
            padding-right: 15px;
            margin-bottom: 10px;
            box-sizing: border-box;
        } */

    .section label {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        height: 32px;
        line-height: 32px;
        font-size: 12px;
    }

    .section > select,
    .section > input {
        width: 100%;
        height: 100%;
        display: block;
        padding: 0 10px;
        box-sizing: border-box;
        border: none;
    }

    input:focus {
        outline-offset: 0px;
    }

    :focus {
        outline: -webkit-focus-ring-color auto 0px;
    }
</style>

<script>

    var p = 1;

    $(document).ready(function () {


        if (getQuery("leixing") == 1) {
            BindMyCustomer("已推荐");
            $("ul li:eq(0) div").css("color", " rgb(234, 171, 87)")
        } else if (getQuery("leixing") == 2) {
            BindMyCustomer("已到访");
            $("ul li:eq(1) div").css("color", " rgb(234, 171, 87)")
        } else if (getQuery("leixing") == 3) {
            BindMyCustomer("已认筹");
            $("ul li:eq(2) div").css("color", " rgb(234, 171, 87)")
        } else if (getQuery("leixing") == 4) {
            BindMyCustomer("已认购");
            $("ul li:eq(3) div").css("color", " rgb(234, 171, 87)")
        } else if (getQuery("leixing") == 5) {
            BindMyCustomer("已签约");
            $("ul li:eq(4) div").css("color", " rgb(234, 171, 87)")
        } else if (getQuery("leixing") == 6) {
            BindMyCustomer("已退房");
            $("ul li:eq(5) div").css("color", " rgb(234, 171, 87)")
        } else if (getQuery("leixing") == 7) {
            BindMyCustomer("已失效");
            $("ul li:eq(6) div").css("color", " rgb(234, 171, 87)")
        } else {
            BindMyCustomer("已推荐");
            $("ul li:eq(0) div").css("color", " rgb(234, 171, 87)")
        }


        BindMyCustomerTypeCount();

        if (getQuery("panduan") == "shouye") {
            $('#a').removeAttr("href");
            $('#a').attr('href', "javascript:void(window.location.href='https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww500458ad942a211f&redirect_uri=http://web.xyufu.cn/PhoneShouYe/ShouYe&response_type=code&scope=snsapi_privateinfo&agentid=1000002&state=STATE#wechat_redirect')");
        } else if (getQuery("panduan") == "geren") {
            $('#a').removeAttr("href");
            $('#a').attr('href', "../PhoneGeRen/GeRenXinXi");
        }
    });

    function getQuery(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return decodeURI(r[2]); return null;
    }

    function BindMyCustomer(LeiXing, pai) {
        var KeHuXingMing = $("#txt_KeHuXingMing").val();
        var DianHuaHaoMa = $("#txt_DianHuaHaoMa").val();
        var KaiShiShiJian = $("#demo_date").val();
        var JieShuShiJian = $("#demo_date1").val();
        if (pai == undefined) {
            pai = "倒序";
        }
        $.ajax({
            type: "POST",
            url: "../PhoneKeHu/BindMyCustomer",
            cache: false,  //禁用缓存
            data: { "Pai": "" + pai + "", "LeiXing": "" + LeiXing + "", "KeHuXingMing": "" + KeHuXingMing + "", "DianHuaHaoMa": "" + DianHuaHaoMa + "", "KaiShiShiJian": "" + KaiShiShiJian + "", "JieShuShiJian": "" + JieShuShiJian + "" },  //传入组装的参数
            dataType: "json",
            success: function (result) {



                if (LeiXing == "已推荐") {
                    LeiXing = 1;
                } else if (LeiXing == "已到访") {
                    LeiXing = 2;
                } else if (LeiXing == "已认筹") {
                    LeiXing = 3;
                } else if (LeiXing == "已认购") {
                    LeiXing = 4;
                } else if (LeiXing == "已签约") {
                    LeiXing = 5;
                } else if (LeiXing == "已退房") {
                    LeiXing = 6;
                } else if (LeiXing == "已失效") {
                    LeiXing = 7;
                } else {
                    LeiXing = 8;
                }

                var kehuhtml = "";
                for (var i = 0; i < result.length; i++) {

                    var touxiang = "";
                    if (result[i].XingBie == "男") {
                        touxiang = "<img style=\"width:35px; height:35px;\" src=\"../GoTRI/img/男.jpg\">";
                    }
                    else {
                        touxiang = "<img style=\"width:35px; height:35px;\" src=\"../GoTRI/img/女.jpg\">";
                    }


                    kehuhtml += "<li class=\"rlist-item\"><a href=\"MyCustomerDetail?KeHuId=" + result[i].Id + "&panduan=" + getQuery("panduan") + "&fanhuiweizhi=" + i + "&leixing=" + LeiXing + "\">" +
                        "<div class=\"item-head\">" +
                        "<div class=\"head-l\">" + touxiang + " <span>" + result[i].KeHuXingMing + "</span></div>" +
                        "<div class=\"head-r\"><a href=\"MyCustomerDetail?KeHuId=" + result[i].Id + "&panduan=" + getQuery("panduan") + "\"><img style=\"padding-top:7px\" src=\"../GoTRI/img/myCustomer/tubiao.png\"></a></div></div>" +
                        "<div class=\"item-body\">" +
                        //"<div class=\"content-top\"><div><span>推荐时间:</span><span>"+result[i].BeiZhu1+"</span></div><div><span>置业顾问:</span><span>汪恒宇 </span>(<span>梁一博组-梁一博团队</span>)</div></div>"+
                        "<div class=\"content-bottom\"><div><span>推荐时间:</span><span>" + result[i].BeiZhu1 + "</span></div><div><span>备注内容:</span><span>" + result[i].KeHuBeiZhu + "</span></div></div>" +
                        "</div></a>" +
                        "<div class=\"item-foot\">" +
                        "<div class=\"foot-left\">" +
                        "<div class=\"tel-img\" ><a  href=\"tel:" + result[i].ShouJiHaoMa + "\"><img style=\"width: 25px; height: 25px;\" src=\"../GoTRI/img/myCustomer/telephone.png\" /></a></div>" +
                        "<div class=\"note-img\" ><a  href=\"sms:" + result[i].ShouJiHaoMa + "\"><img style=\"width: 25px; height: 25px;\" src=\"../GoTRI/img/myCustomer/note.png\"></a></div>" +
                        "</div>" +
                        "<div class=\"foot-right\">" +
                        "<a href=\"MyCustomerDetail?KeHuId=" + result[i].Id + "&panduan=" + getQuery("panduan") + "\"><img src=\"../GoTRI/img/myCustomer/revise.png\"></a></div></div></li>";
                    //if (i == result.length - 1) {
                    //}
                }
                $("#ul_main").html(kehuhtml + "<br/><br/>");
                var s = getQuery("fanhuiweizhi");
                if (s != null) {
                    var i = new Number(s);
                    if (i < 5) {
                        $('ul').scrollTop(
                            $('ul').find('li:eq(' + i + ')').offset().top - $('ul').offset().top + $('ul').scrollTop()
                        );
                    } else {
                        $('ul').scrollTop(
                            $('ul').find('li:eq(' + (i - 1) + ')').offset().top - $('ul').offset().top + $('ul').scrollTop()
                        );
                    }
                }
            }
        });
    }
    function BindMyCustomerTypeCount() {
        var KeHuXingMing = $("#txt_KeHuXingMing").val();
        var DianHuaHaoMa = $("#txt_DianHuaHaoMa").val();
        var KaiShiShiJian = $("#demo_date").val();
        var JieShuShiJian = $("#demo_date1").val();
        $.ajax({
            type: "POST",
            url: "../PhoneKeHu/BindMyCustomerTypeCount",
            cache: false,  //禁用缓存
            data: { "KeHuXingMing": "" + KeHuXingMing + "", "DianHuaHaoMa": "" + DianHuaHaoMa + "", "KaiShiShiJian": "" + KaiShiShiJian + "", "JieShuShiJian": "" + JieShuShiJian + "" },  //传入组装的参数
            dataType: "json",
            success: function (result) {
                for (var i = 0; i < result.length; i++) {
                    $("#lbl_YiTuiJian").text(result[0].YiTuiJian);
                    $("#lbl_YiDaoFang").text(result[0].YiDaoFang);
                    $("#lbl_YiRenChou").text(result[0].YiRenChou);
                    $("#lbl_YiRenGou").text(result[0].YiRenGou);
                    $("#lbl_YiQianYue").text(result[0].YiQianYue);
                    $("#lbl_YiTuiFang").text(result[0].YiTuiFang);
                    $("#lbl_YiShiXiao").text(result[0].YiShiXiao);
                }
            }
        });
    }


    function ChongZhi() {
        $("#txt_KeHuXingMing").val("");
        $("#txt_DianHuaHaoMa").val("");
        $("#demo_date").val("");
        $("#demo_date1").val("");
        BindMyCustomer("已推荐");
        BindMyCustomerTypeCount();
        $("#shaixuan").hide();
    }

    function ChaXun() {
        BindMyCustomer("已推荐");
        BindMyCustomerTypeCount();
        $("#shaixuan").hide();
    }

    function PaiXu() {
        if (p == 0) {
            $("#img_PaiXu")[0].src = "/GoTRI/img/myCustomer/revise1.png";
            p = 1;
            BindMyCustomer($("li[style='color: rgb(234, 171, 87);'] div:eq(1)").text(), "倒序");
        }
        else {
            p = 0;
            $("#img_PaiXu")[0].src = "/GoTRI/img/myCustomer/revise2.png";
            $("li[style='color: rgb(234, 171, 87);'] div:eq(1)").text()
            BindMyCustomer($("li[style='color: rgb(234, 171, 87);'] div:eq(1)").text(), "正序");
        }


    }
</script>
<header style="width: 100%; height: 4rem; background-color: rgb(255,135,0);top:0px;position: fixed;z-index: 1;">
    <a href="javascript:void(window.location.href='https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww500458ad942a211f&redirect_uri=http://web.xyufu.cn/PhoneShouYe/ShouYe&response_type=code&scope=snsapi_privateinfo&agentid=1000002&state=STATE#wechat_redirect')" id="a">
        <img src="~/GoTRI/img/left.png" alt="" style="float: left;
            width: 1rem;
            height: 2rem;
            margin-left: 1rem;
            margin-top: 1rem;
            position:absolute;
	        left:0px;
	        top:0px;
	        z-index:1;">
    </a>
    <div style=" width: 100%; height: 4rem; line-height: 4rem; text-align: center; color: #fff; font-size: 1.3rem;">我的客户</div>
</header>
<div style="width:1px;padding-bottom:60px"></div>
<!-- 页面主体 -->
<div class="main">
    @*<label id="cunid" onclick="qwe()">sdasdasd</label>*@
    <!-- 页面左侧列表 -->
    <div class="main-l">
        <ul>
            <li onclick="BindMyCustomer('已推荐');">
                <div><label id="lbl_YiTuiJian">0</label></div>
                <div>已推荐</div>
            </li>
            <li onclick="BindMyCustomer('已到访');">
                <div><label id="lbl_YiDaoFang">0</label></div>
                <div>已到访</div>
            </li>
            <li onclick="BindMyCustomer('已认筹');">
                <div><label id="lbl_YiRenChou">0</label></div>
                <div>已认筹</div>
            </li>
            <li onclick="BindMyCustomer('已认购');">
                <div><label id="lbl_YiRenGou">0</label></div>
                <div>已认购</div>
            </li>
            <li onclick="BindMyCustomer('已签约');">
                <div><label id="lbl_YiQianYue">0</label></div>
                <div>已签约</div>
            </li>
            <li onclick="BindMyCustomer('已退房');">
                <div><label id="lbl_YiTuiFang">0</label></div>
                <div>已退房</div>
            </li>
            <li onclick="BindMyCustomer('已失效');">
                <div><label id="lbl_YiShiXiao">0</label></div>
                <div>已失效</div>
            </li>
        </ul>
    </div>
    <!-- 页面右侧主体 -->
    <div class="main-r">
        <!-- 页面右侧 固定选项栏 -->
        <div class="main-rtop">
            <div onclick="PaiXu();">
                <span>推荐时间</span>
                <img style="width:10px;height:15px" src="/GoTRI/img/myCustomer/revise1.png" id="img_PaiXu">
            </div>
            <div class="screen">
                <span>筛选</span>
                <img src="~/GoTRI/img/myCustomer/screen.png">
            </div>
        </div>
        <!-- 页面右侧 详情列表 -->
        <ul class="main-rlist" id="ul_main" style="padding-right:0px;">
        </ul>
    </div>
</div>
<!-- 筛选功能 -->
<div id="shaixuan">
    <div class="shaixuan-left"></div>
    <div class="shaixuan-content">

        <div>客户姓名</div>
        <div class="firstvisit-time">
            <div>
                <input type="text" class="form-control" id="txt_KeHuXingMing" placeholder="客户姓名" />
            </div>
        </div>
        <div>联系电话</div>
        <div class="firstvisit-time">
            <div>
                <input type="text" class="form-control" id="txt_DianHuaHaoMa" placeholder="电话号码" />
            </div>
        </div>
        <div>推荐时间</div>
        <div class="recommend-time">
            <div class="recbtn section">
                <input type="text" id="demo_date" class="starttime" placeholder="开始时间" />
            </div>
            <div class="rec-line"></div>
            <div class="recbtn section">
                <input type="text" id="demo_date1" class="endtime" placeholder="结束时间" />
            </div>
        </div>
        <div class="shaixuan-foot">
            <div class="reset" onclick="ChongZhi();">重置</div>
            <div class="query" onclick="ChaXun();">查询</div>
        </div>
    </div>

</div>
<!-- 电话插件 -->
<div id="telephone">
    <div>
        <div class="tel">18345068265</div>
        <div class="mybtn">
            <div class="cancel">取消</div>
            <div>拨打</div>
        </div>
    </div>
</div>
<!-- 短信插件 -->
<div id="note">
    <div>
        <div class="tel">18345068265</div>
        <div class="mybtn">
            <div class="cancel">取消</div>
            <div>发短信</div>
        </div>
    </div>
</div>
<script>
    var theme = "ios";
    var mode = "scroller";
    var display = "bottom";
    var lang = "zh";
    $('#demo_date,#demo_date1,#demo_date2,#demo_date3').mobiscroll().date({
        theme: theme,
        mode: mode,
        display: display,
        lang: lang
    });

    //function qwe()
    //{
    //    alert("1231231231");
    //    var s = getQuery("fanhuiweizhi");
    //    var i = new Number(s);
    //    $('ul').scrollTop(
    //        $('ul').find('li:eq(' + i + ')').offset().top - $('ul').offset().top + $('ul').scrollTop()
    //    );
    //}
    //$(window).bind("load", function () {
    //    var s = getQuery("fanhuiweizhi");
    //    var i = new Number(s);
    //    $('ul').scrollTop(
    //        $('ul').find('li:eq(' + i + ')').offset().top - $('ul').offset().top + $('ul').scrollTop()
    //    );
    //})
</script>
